/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  height: 100vh;
}

.container {
  max-width: 90%;
  margin: 0 auto;
  padding: 20px;
}

.title {
  text-align: center;
  color: #2196F3;
  margin-bottom: 30px;
  font-size: 2em;
}

/* 主要内容布局 */
.main-content {
  display: flex;
  gap: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
}

/* 控制面板样式 */
.control-panel {
  min-width: 420px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.panel-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.panel-section h3 {
  color: #2196F3;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* 预览区域样式 */
.preview-section {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* 上传区域样式优化 */
.upload-area {
  margin-bottom: 20px;
  padding: 40px 20px;
  border: 2px dashed #2196F3;
  border-radius: 8px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  background: #f8f9fa;
  cursor: pointer;
}

.upload-area:hover {
  background: #e3f2fd;
  border-color: #1976D2;
}

.upload-area.drag-over {
  background: #e3f2fd;
  border-color: #1976D2;
  transform: scale(1.02);
}

.upload-content {
  position: relative;
  z-index: 1;
}

.upload-icon {
  width: 64px;
  height: 64px;
  fill: #2196F3;
  margin-bottom: 16px;
}

.upload-text {
  font-size: 1.2em;
  color: #2196F3;
  margin-bottom: 8px;
}

.upload-tip {
  color: #666;
  font-size: 0.9em;
}

/* 隐藏原始文件输入框 */
#file {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* 文件输入框的焦点样式 */
#file:focus + .upload-content {
  outline: 2px solid #2196F3;
  outline-offset: -2px;
}

/* 控制组件样式优化 */
.control-group {
  margin: 15px 0;
  display: flex;
  align-items: center;
}

.control-group label {
  width: 100px;
  color: #555;
  font-size: 0.95em;
}

input[type="text"],
input[type="range"],
select {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

input[type="range"] {
  height: 6px;
  background: #e0e0e0;
  cursor: pointer;
}

input[type="color"] {
  width: 50px;
  height: 35px;
  padding: 0;
  border: none;
  border-radius: 4px;
}

/* 按钮样式 */
.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.primary-btn {
  background: #2196F3;
  color: white;
}

.primary-btn:hover {
  background: #1976D2;
}

.warning-btn {
  background: #FF9800;
  color: white;
}

.warning-btn:hover {
  background: #F57C00;
}

.success-btn {
  background: #4CAF50;
  color: white;
}

.success-btn:hover {
  background: #388E3C;
}

/* 其他现有样式保持不变 */
.controls {
  margin: 20px 0;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 5px;
}

#watermarkText {
  padding: 5px;
  width: 200px;
}

#watermarkColor {
  width: 50px;
  height: 30px;
  padding: 0;
  border: none;
}

#watermarkOpacity,
#watermarkRotation,
#watermarkSize {
  width: 200px;
  margin-right: 10px;
}

#pre-image {
  max-width: 100%;
  border: 1px solid #ccc;
}

#waterSet {
  display: none;
}

.imgBox {
  margin: 20px 0;
}

span {
  min-width: 40px;
}

#exportQuality {
  padding: 5px;
  width: 200px;
  height: 35px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
}

#exportQuality:focus {
  outline: none;
  border-color: #4CAF50;
}

.preview-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  min-height: 360px;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.3s;
  z-index: 1;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.nav-btn:disabled {
  background: rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
}

.prev-btn {
  left: 10px;
}

.next-btn {
  right: 10px;
}

.preview-info {
  text-align: center;
  margin-top: 10px;
}

#preview-counter {
  font-weight: bold;
  color: #666;
}

#pre-image {
  max-width: 100%;
  border: 1px solid #ccc;
  transition: all 0.3s ease;
  opacity: 1;
  transform: scale(1);
}

#pre-image.transitioning {
  opacity: 0.6;
  transform: scale(0.98);
}

#watermarkFont {
  padding: 5px;
  width: 200px;
  height: 35px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
}

#watermarkFont:focus {
  outline: none;
  border-color: #4CAF50;
}
